]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
search: fix description of results
authorGiovanni Campagna <gcampagna@src.gnome.org>
Wed, 27 Feb 2013 16:54:09 +0000 (17:54 +0100)
committerGiovanni Campagna <gcampagna@src.gnome.org>
Thu, 28 Feb 2013 23:38:50 +0000 (00:38 +0100)
"description" is documented as a valid field for search result metas,
and ListSearchResults implements it, so pass it down to be used.
Also, don't wrap the description in quotes, so that the search provider
can decide if it is an excerpt from the searched text or something else.
And to that extent, set use_markup to true, so that terms can be
highlighted.

https://bugzilla.gnome.org/show_bug.cgi?id=694906

js/ui/remoteSearch.js
js/ui/searchDisplay.js

index 64af9e9c05af51d89dcdab219d502c4a20599e1a..cd6afdf5ac435a6e63e5e1e4e3fa7a86c97c31fb 100644 (file)
@@ -255,6 +255,7 @@ const RemoteSearchProvider = new Lang.Class({
                 metas[i][prop] = metas[i][prop].deep_unpack();
             resultMetas.push({ id: metas[i]['id'],
                                name: metas[i]['name'],
+                               description: metas[i]['description'],
                                createIcon: Lang.bind(this,
                                                      this.createIcon, metas[i]) });
         }
index c54cd00070fb5474f2e4f8bd8dc3078930dcee61..bdc45e43d337a9a2ac6d919b3af67064f1d7be22 100644 (file)
@@ -103,10 +103,9 @@ const ListSearchResult = new Lang.Class({
                              x_align: St.Align.START,
                              y_align: St.Align.START });
 
-        // TODO: should highlight terms in the description here
         if (this.metaInfo['description']) {
-            let description = new St.Label({ style_class: 'list-search-result-description',
-                                             text: '"' + this.metaInfo['description'] + '"' });
+            let description = new St.Label({ style_class: 'list-search-result-description' });
+            description.clutter_text.set_markup(this.metaInfo['description']);
             details.add(description, { x_fill: false,
                                        y_fill: false,
                                        x_align: St.Align.START,